package com.xbongbong.saas.domain.entity;

import lombok.Getter;
import lombok.Setter;

/**
 * 序列号结存实体
 *
 * @author jiantao.xiong
 * @date 2020/5/18
 */
@Setter//
@Getter
public class ProductSerialBalanceEntity {

    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 父产品id
     */
    private Long parentId;
    /**
     * 子产品id
     */
    private long productId;
    /**
     * 序列号
     */
    private String seq;
    /**
     * 备注
     */
    private String memo;
    /**
     * 产品结存状态 0：在库 1：出库
     */
    private Integer status;
    /**
     * 业务发生时间
     */
    private Long date;
    /**
     * 业务类型
     */
    private Integer businessType;
    /**
     * 关联单据id
     */
    private Long refId;
    /**
     * 关联单据名称
     */
    private String refSheetNo;
    /**
     * 仓库ID
     */
    private Long warehouseId;
    /**
     * 往来单位
     */
    private Long businessId;
    /**
     * 往来单位名称
     */
    private String businessName;
    /**
     * productId + seq
     */
    private String seqKey;
    /**
     * 创建时间
     */
    private Long addTime;
    /**
     * 更新时间
     */
    private Long updateTime;
    /**
     * 删除时间
     */
    private Integer del;

    private Integer visible;

    /**
     *  单据关联产品id
     */
    private Long refProductId;

    ProductSerialBalanceEntity(){
        this.visible = 1;
    }

    public ProductSerialBalanceEntity(ProductSerialFlowEntity productSerialFlowEntity){
        this.corpid = productSerialFlowEntity.getCorpid();
        this.parentId = productSerialFlowEntity.getParentId();
        this.productId = productSerialFlowEntity.getProductId();
        this.seq = productSerialFlowEntity.getSeq();
        this.memo = productSerialFlowEntity.getMemo();
        this.status = productSerialFlowEntity.getStatus();
        this.date = productSerialFlowEntity.getDate();
        this.businessType = productSerialFlowEntity.getBusinessType();
        this.refId = productSerialFlowEntity.getRefId();
        this.refSheetNo = productSerialFlowEntity.getRefSheetNo();
        this.refProductId = productSerialFlowEntity.getRefProductId();
        this.warehouseId = productSerialFlowEntity.getWarehouseId();
        this.businessId = productSerialFlowEntity.getBusinessId();
        this.businessName = productSerialFlowEntity.getBusinessName();
        this.seqKey = productSerialFlowEntity.getSeqKey();
        this.del = productSerialFlowEntity.getDel();
        this.visible = 1;
    }
}
